/** 
 *当前的文件主要是对接接口文档里面的adminInfo管理员模块的接口
 */
 import axiosIntance from "../axiosInstance";

const adminInfo= {
    //新增管理员的接口方法
    add({admin_name ,admin_pwd,admin_sex,admin_email ,admin_tel }) {
        //这个方法是为了将数据发送到服务器
        axiosIntance.post("/admin-info/add",{
            admin_name ,admin_pwd,admin_sex,admin_email ,admin_tel
        });
    },
    findAll() {
        return axiosIntance.get("/admin-info/findAll");
    },
    //根据id删除某一条数据
    deleteById(id) {
        return axiosIntance.delete(`/admin-info/deleteById/`+id);
    },
    //分页查询管理员信息
    //注意get请求的参数与post请求的参数配置是不一样的
    getListByPage({pageIndex,admin_name,admin_tel,admin_email}) {
        return axiosIntance.get("/admin-info/getListByPage",{
            params:{
                pageIndex,admin_name,admin_tel,admin_email
            }
        });
    },
    //更新管理员信息
    update({id,admin_name,admin_sex,admin_email,admin_tel}) {
        return axiosIntance.patch("/admin-info/update/"+id,{
            admin_name,admin_sex,admin_email,admin_tel
        });
    }
}

export default adminInfo;